<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      /* content-box 默认 扩展整体宽高 盒子模型  padding border margin 盒子模型 */
      .box1 {
        width: 200px;
        height: 200px;
        background-color: orange;
        padding: 5px;
        border: 5px solid black;
      }
      /* border-box 压缩整体宽高 内容区域变小  */
      .box2 {
        width: 200px;
        height: 200px;
        background-color: red;
        padding: 5px;
        border: 5px solid black;
        box-sizing: border-box;
      }
    </style>
  </head>
  <body>
    <div class="box1">盒子属性content-box默认</div>
    <div class="box2">盒子属性border-box</div>
  </body>
</html>
